<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To fetch the Specified Registry Data with its all-sub folders data's # Configuration Type - COMPUTER / USER # Note: If it is Computer Based Hive the configuration to be executed as Computer Based configuration If it is User Based Hive the configuration to be executed as User Based configuration # Arguments: The registry path needs to be hardcoded #> # Define the initial registry hive path (Hardcode the Regsitry Path Here) $initialRegistryHive = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" function Get-RegistryValues { param ( [string]$RegistryPath ) # Check if the registry path exists if (Test-Path -Path $RegistryPath) { # Get the registry key for the specified path $registryKey = Get-Item -LiteralPath $RegistryPath # Get all the registry values under the specified key $registryValues = $registryKey | Get-ItemProperty # Output the registry value names, data, and data type foreach ($value in $registryValues.PSObject.Properties) { $valueName = $value.Name $valueData = $value.Value $valueType = $value.TypeNameOfValue Write-Host "Registry Path: $RegistryPath" Write-Host " Value Name: $valueName" Write-Host " Value Data: $valueData" Write-Host " Data Type: $valueType" Write-Host "" } # Iterate through subfolders (subkeys) $subKeys = Get-ChildItem -Path $RegistryPath foreach ($subKey in $subKeys) { Get-RegistryValues -RegistryPath $subKey.PSPath } } else { Write-Host "Registry path does not exist: $RegistryPath" } } # Call the function with the initial registry hive path Get-RegistryValues -RegistryPath $initialRegistryHive